import request from '@/utils/request'
/*
 * 获取组内报表信息
 */

export function getScore(data) {
  return request({
    url: '/task/getScore',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      type: 2,
      data
    }
  })
}
/*
 * 获取组内报表所有小组
 */

export function getAllCategory() {
  return request({
    url: '/category/getAll',
    method: 'get',
  })
}

/*
 * 获取品牌报表所有品牌
 */

export function getAllBrand() {
  return request({
    url: '/brand/getAllBrand',
    method: 'get',
  })
}

/*
 * 获取品牌报表某个品牌下的成本中心
 */

export function getbrandCostcenter(params) {
  return request({
    url: '/brand/getbrandCostcenter',
    method: 'get',
    params: {
      brandId: params.brandId,
      startTime: params.startTime,
      endTime: params.endTime
    }
  })
}

/*
 * 获取品牌报表某个品牌下的成本中心
 * 各物料占比数据，设计师分值占比
 */

export function getmatAndUserScore(id, subId, start, end) {
  return request({
    url: `/brand/getmatAndUserScore?brandId=${id}&costCenterId=${subId}&startTime=${start}&endTime=${end}`,
    method: 'get',
  })
}


/*
 * 获取员工报表全部组员
 */

export function getUser45() {
  return request({
    url: `/user/getUser45`,
    method: 'get',
  })
}

/*
* 查看员工报表个人信息
 */

export function getUserTesk(data) {
  return request({
    url: `/task/getUserTesk`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      data,
      type: 2
    }
  })
}

/*
 * 获取部门报表初始化信息
 */

export function getDepartment(data) {
  return request({
    url: `/task/getDepartment`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      data,
      type: 2
    }
  })
}

/*
 * 获取部门报表
  平均分值
*/

export function getDepartmentAvg(data) {
  return request({
    url: `/task/getDepartmentAvg`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: {
      data,
      type: 2
    }
  })
}